@extends("admin.layout.main")

@section('css')
	<link rel="stylesheet" href="/adstatic/order/order.css" media="all" />
@endsection

@section("content")

	<form class="layui-form" action="">
		<blockquote class="layui-elem-quote news_search">
			<div class="layui-inline">
				<div class="layui-input-inline">
					<input type="text" value="{{ $querystr }}" placeholder="请输入关键字" class="layui-input search_input">
				</div>
				<div class="layui-input-inline">
					<select name="status" class="select-status" lay-verify="required" >
						<option value="-1" {{$status==-1?'selected':''}}>全部</option>
						<option value="0"  {{$status==0?'selected':''}}>未上架</option>
						<option value="1"  {{$status==1?'selected':''}}>上架</option>
					</select>
				</div>
				<a class="layui-btn search_btn" >查询</a>
			</div>

			<div class="layui-inline">
				<a class="layui-btn add-btn">添加商品</a>
			</div>
		</blockquote>
	</form>


	<div class="layui-form order_list">
		<table class="layui-table">
			<thead>
			<tr>
				<th>商品名</th>
				<th>所需积分</th>
				<th>市场价格</th>
				<th>允许兑换的会员等级</th>
				<th>商品封面图</th>
				<th>是否上架</th>
				<th>运费</th>
				<th>库存</th>
				<th>销量</th>
				<th>创建时间</th>
				<th>操作</th>
			</tr>
			</thead>
			<tbody class="show-my-children">
			@foreach($data as $o)
				<tr>
					<td>
						{{$o->goods_name}}
					</td>
					<td>
						{{$o->scores}}
					</td>
					<td>
						{{$o->market_price}}
					</td>
					<td>
						{{$o->allow_level}}
					</td>
					<td class="goods-photo-face">
						<img src="{{$o->cover}}" title="点击查看大图" alt="商品封面图"  layer-src="{{$o->cover}}" style="width:80px;height:80px;"/>
					</td>
					<td>
						<input data-id="{{ $o->goods_id }}"  data-status="{{$o->status}}" type="checkbox" lay-skin="switch" lay-text="是|否" lay-filter="Is_Shelves"
							   @if ($o->status == 1) checked @endif>
					</td>
					<td>
						{{$o->Freight}}
					</td>
					<td>
						{{$o->rest}}
					</td>
					<td>
						{{$o->sale}}
					</td>
					<td>
						{{date('Y-m-d H:i:s',$o->create_time)}}
					</td>
					<td>
						<a data-id="{{$o->goods_id}}" class="layui-btn layui-btn-mini look-detail" >
							<i class="layui-icon"></i>
							查看详情
						</a>
						<a data-id="{{$o->goods_id}}" class="layui-btn layui-btn-normal layui-btn-mini edit-btn">
							<i class="layui-icon">&#xe642;</i>
							编辑
						</a>
						<a data-id="{{$o->goods_id}}" class="layui-btn layui-btn-danger layui-btn-mini goods_del">
							<i class="layui-icon"></i>
							删除
						</a>
					</td>
				</tr>
			@endforeach
			</tbody>
		</table>
	</div>
	<div style="text-align: right;">
		{{ $data->links('admin.layout.paginate') }}
	</div>


@endsection

@section('js')
	<script type="text/javascript" src="/js/jquery.min.js"></script>
	<script type="text/javascript" src="/adstatic/goods/goods.js"></script>
@endsection